package com.gouaixin.bee.beeframework2.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.ab.util.AbToastUtil;
import com.gouaixin.bee.beeframework2.R;
import com.gouaixin.bee.beeframework2.tool.PreferencesUtils;
import com.gouaixin.bee.beeframework2.tool.mLog;

/**
 * Created by Administrator on 2015/3/10.
 */
//真心话回答界面
public class B25_zhenxinhuaHuidaActivity extends FragmentActivity {
    Context context=B25_zhenxinhuaHuidaActivity.this;

    //顶部
    ImageView back;//返回
    TextView title;//标题
    TextView right;//顶部右边图标



    //内容区
    EditText input;

    String jid="";
    String cid="";



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.b25_zhenxinhuahuida);
        Intent it=getIntent();
        jid=it.getStringExtra("jid");
        cid= PreferencesUtils.getString(context, "cid");

        mLog.e("B25_zhenxinhuaHuidaActivity___jid=" + jid);
        mLog.e("B25_zhenxinhuaHuidaActivity___cid=" + cid);

        initView();

        setData();

        setListener();
    }

    private void initView() {
        back= (ImageView) findViewById(R.id.back);
        title= (TextView) findViewById(R.id.title);
        right= (TextView) findViewById(R.id.back2);

        input= (EditText) findViewById(R.id.input);

    }


    private void setData() {



    }

    private void setListener() {
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        right.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String daanStr=input.getText().toString();

                mLog.e("daanStr=" + daanStr);
                if(daanStr.equals("")){

                    AbToastUtil.showToast(context,"回答不能为空哦！");

                }else{
                    Intent it=new Intent(context,B23_zhenxinhuaActivity.class);
                    it.putExtra("daan",daanStr);
                    setResult(1, it);
                    finish();
                }

            }
        });




    }
}
